package day13;

import java.io.*;
import java.net.Socket;

//客户端
public class Client1 {
    public static void main(String[] args) throws IOException {
        Socket client=new Socket("192.168.26.25",60000);
        //创建输入和输出流
        InputStream is=client.getInputStream();
        OutputStream os=client.getOutputStream();
        //将字节转字符 加缓冲流 readLine
        BufferedReader br=new BufferedReader(
                new InputStreamReader(is)
        );
        String result=br.readLine();
        System.out.println("服务端数据:"+result);
        os.write("你好,我是客户端\n".getBytes());
    }
}
